package com.mhwx.mhlive.ui.fragment;

import android.os.Bundle;
import android.widget.TextView;

import com.mhwx.mhlive.R;
import com.mhwx.mhlive.ui.base.BaseFragment;

import butterknife.BindView;

/**
 * 类功能描述
 *
 * @author Guol
 * @version 1.0
 * @copyright 北京明华维新信息技术有限公司
 * @time 2017/4/24
 */
public class ChoiceItemFrgament extends BaseFragment {
    @BindView(R.id.tv_titl)
    TextView textView;

    public static String TABLAYOUT_FRAGMENT = "tab_fragment";
    private int type;
    @Override
    protected int getLayoutRes() {
        return R.layout.frm_choice_item;
    }
    public static ChoiceItemFrgament newInstance(int type) {
        ChoiceItemFrgament fragment = new ChoiceItemFrgament();
        Bundle bundle = new Bundle();
        bundle.putSerializable(TABLAYOUT_FRAGMENT, type);
        fragment.setArguments(bundle);
        return fragment;
    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        init();
    }
    private void init(){
        textView.setText(type+"");
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            type = (int) getArguments().getSerializable(TABLAYOUT_FRAGMENT);
        }
    }
}
